<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>测试API</title>
<script type="text/javascript" src="${ctxStatic}/assets/sys/statistics.js"></script>
<style type="text/css">
body{font-size:1.3rem;font-family: Helvetica, Georgia, Arial, sans-serif, 宋体	}
input{width:100%}
</style>
</head>
<body>
	<sys:message content="${message}" />
	<div class="am-g">
		<div class="am-u-sm-6">
			<script id="ver-tpl" type="text/x-handlebars-template">
				<table class="am-table am-table-bd am-table-striped admin-content-table">
					<caption>客户端版本统计  在线量：[安卓:{{ifnullZero android}} / 苹果:{{ifnullZero ios}}]</caption>
					<thead><tr><th>客户端</th><th>最后访问日期</th></tr></thead>
					
					<tbody>
					
					{{#each lastlogin}}
  						<tr class="row">
							<td>{{uid}}</td>
							<td>{{os}}</td>
							<td>{{vers}}</td>
							<td>{{channel}}</td>
							<td>{{time}}</td>
						</tr>
					{{/each}}
					</tbody>
				</table>
				</script>
		</div>
		<div class="am-u-sm-6">
			<script id="last10-tpl" type="text/x-handlebars-template">
				<table class="am-table am-table-bd am-table-striped admin-content-table">
					<caption>最后10名注册时间</caption>
					<thead><tr><th>uid</th><th>注册时间</th></tr></thead>
					<tbody>
					{{#each this}}
  						<tr>
							<td>{{uid}}</td>
							<td>{{regtime}}</td>
						</tr>
					{{/each}}
					</tbody>
				</table>
				</script>
		</div>
		
		<div class="am-u-sm-12">
			<script id="hourstat-tpl" type="text/x-handlebars-template">
				<table class="am-table am-table-bd am-table-striped admin-content-table">
					<caption>两日内每小时统计情况</caption>
					<thead><tr><th>&nbsp;</th>{{#each loop}}<th>{{@index}}</th>{{/each}}</tr></thead>
					<tbody>
					<tr>
						<td rowspan='2'>注册数</td>
						{{#each yesterday}}<td>{{aRegcnt}}/{{iRegcnt}}</td>{{/each}}
					</tr>
					<tr>{{#each today}}<td>{{aRegcnt}}/{{iRegcnt}}</td>{{/each}}</tr>

					<tr>
						<td rowspan='2'>会员数</td>
						{{#each yesterday}}<td>{{aPaycnt}}/{{iPaycnt}}</td>{{/each}}
					</tr>
					<tr>{{#each today}}<td>{{aPaycnt}}/{{iPaycnt}}</td>{{/each}}</tr>

					<tr>
						<td rowspan='2'>收入</td>
						{{#each yesterday}}<td>{{aMoneysum}}/{{iMoneysum}}</td>{{/each}}
					</tr>
					<tr>{{#each today}}<td>{{aMoneysum}}/{{iMoneysum}}</td>{{/each}}</tr>

					</tbody>
				</table>
				</script>
		</div>
		<div class="am-u-sm-12">
			<table class="am-table am-table-bd am-table-striped admin-content-table">
				<caption>收入统计</caption>
				<thead><tr>
						<th>&nbsp;</th>
						<th>支付宝/天</th>
						<th>微信/天</th>
						<th>IAP/天</th>
						<th>合计/天</th>
						<th>年会员(anroid/ios)</th>
					</tr>
				</thead>
				<tbody>
				<script id="money-tpl" type="text/x-handlebars-template">
					{{#each days}}
  						<tr class="row">
							<td>{{showday @index}}</td>
							<td>{{alicnt}}笔&nbsp;/&nbsp;{{cal alimoney '/' 100}}元</td>
							<td>{{wxcnt}}笔&nbsp;/&nbsp;{{cal wxmoney '/' 100 }}元</td>
							<td>{{iapcnt}}笔&nbsp;/&nbsp;{{cal iapmoney '/' 100 }}元</td>
							<td>{{cnt}}笔&nbsp;/&nbsp;{{cal money '/' 100 }}元</td>
							<td>{{ayearlvlcnt}}/{{iyearlvlcnt}}</td>
						</tr>
					{{/each}}
					<tr class="row">
						<td>两周平均</td>
						<td>{{calint KEY_WEEK_ALI_CNT '/' KEY_DAYS_LENGTH}}笔&nbsp;/&nbsp;{{cal KEY_WEEK_ALI_AVG '/' 100}}元</td>
						<td>{{calint KEY_WEEK_WX_CNT '/' KEY_DAYS_LENGTH}}笔&nbsp;/&nbsp;{{cal KEY_WEEK_WX_AVG '/' 100}}元</td>
						<td>{{calint KEY_WEEK_IAP_CNT '/' KEY_DAYS_LENGTH}}笔&nbsp;/&nbsp;{{cal KEY_WEEK_IAP_AVG '/' 100}}元</td>
						<td>{{calint KEY_WEEK_CNT '/' KEY_DAYS_LENGTH}}笔&nbsp;/&nbsp;{{cal KEY_WEEK_MONEY_AVG '/' 100}}元</td>
						<td>{{calint KEY_WEEK_AYEARLVL_CNT '/' KEY_DAYS_LENGTH}}/{{calint KEY_WEEK_IYEARLVL_CNT '/' KEY_DAYS_LENGTH}}</td>
					</tr>
					<tr class="row">
						<td>本月总共(毛/纯)</td>
						<td colspan='5'>{{cal monthmoney '/' 100}}元&nbsp;/&nbsp;{{cal monthrealmoney '/' 100}}元</td>
					</tr>
					</script>
				</tbody>
			</table>
		</div>
	</div>
<!-- hidden -->	
	<div class="am-modal am-modal-prompt" tabindex="-1" id="userEditLayer">
	  <div class="am-modal-dialog">
	    <div class="am-modal-hd">用户{{uid}}/{{phone}}/{{nick}}</div>
	    <div class="am-modal-bd">
	    <input type="text" class="am-modal-prompt-input" value="{{lvl}}" placeholder="级别">
<!-- 	       	级别:<select name="lvl" data-am-selected="{btnSize: 'sm'}"> -->
<!-- 						<option value="">取消会员</option> -->
<!-- 						<option value="TRY">TRY</option> -->
<!-- 						<option value="YEAR">YEAR</option> -->
<!-- 				</select> -->
<!-- 				<input type="hidden" name="uid" value="{{}}"/> -->
	    </div>
	    <div class="am-modal-footer">
	      <span class="am-modal-btn" data-am-modal-cancel>取消</span>
	      <span class="am-modal-btn" data-am-modal-confirm>保存</span>
	    </div>
	  </div>
	</div>
</body>
</html>